#pragma once
#include <windows.h>
class CNfxSemaphore
{
public:
    CNfxSemaphore(int iInitCount = 0, int iMaxCount = LONG_MAX, LPSECURITY_ATTRIBUTES lpSemaphoreAttributes = NULL);
    ~CNfxSemaphore();

    int Release(LONG lReleaseCount = 1,LPLONG lpPreviousCount = NULL);
    int WaitSingle(DWORD dwMilliseconds = INFINITE);
private:
    HANDLE hSemaphore;
};

